package com.woniuxy.house.mapper;

import com.woniuxy.house.entity.Config;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 房间配置的mapper
 */
public interface ConfigMapper {
    /**
     * 增加房屋配置
     * @魏锦鹏
     */
    @Insert("insert into house_config(name) values (#{name})")
    void add(Config config);
    /**
     * 查询配置
     * @魏锦鹏
     */
    @Select("select*from house_config")
    List<Config> selectAll();

	/**
	 * 通过房源id查配置
	 * @param sid
	 * @return
	 */
	@Select("select * from house_config,house_source_config where house_source_config.source_id=#{sid} and house_source_config.config_id=house_config.id")
	List<Config> getBySid(Integer sid);
}
